package com.example.camerapush;

import android.app.AlertDialog;
import android.graphics.Bitmap;
import android.util.Log;

import com.example.camerapush.ptp.Camera;
import com.example.camerapush.ptp.model.LiveViewData;
import com.yanzhenjie.fragment.CompatActivity;

/**
 * Author:lsh
 * Version: 1.0
 * Description:
 * Date: 2018/2/20
 */

public abstract class MyCameraListener extends CompatActivity implements Camera.CameraListener {

    private static final String TAG = "main";


    @Override
    public void onPropertyChanged(int property, int value) {
//        Log.e(TAG, "onPropertyChanged");
    }

    @Override
    public void onPropertyStateChanged(int property, boolean enabled) {
//        Log.e(TAG, "onPropertyStateChanged");
    }

    @Override
    public void onPropertyDescChanged(int property, int[] values) {
        Log.e(TAG, "onPropertyDescChanged");
    }

    @Override
    public void onLiveViewStarted() {
        Log.e(TAG, "onPropertyChanged");
    }

    @Override
    public void onLiveViewData(LiveViewData data) {
        Log.e(TAG, "onLiveViewData");
    }

    @Override
    public void onLiveViewStopped() {
        Log.e(TAG, "onLiveViewStopped");
    }

    @Override
    public void onCapturedPictureReceived(int objectHandle, String filename, Bitmap thumbnail, Bitmap bitmap) {
        Log.e(TAG, "onCapturedPictureReceived");
    }

    @Override
    public void onBulbStarted() {
        Log.e(TAG, "onBulbStarted");
    }

    @Override
    public void onBulbExposureTime(int seconds) {
        Log.e(TAG, "onBulbExposureTime");
    }

    @Override
    public void onBulbStopped() {
        Log.e(TAG, "onBulbStopped");
    }

    @Override
    public void onCameraStopped(Camera camera) {

    }

    @Override
    public void onFocusStarted() {
        Log.e(TAG, "onFocusStarted");
    }

    @Override
    public void onFocusEnded(boolean hasFocused) {
        Log.e(TAG, "onFocusEnded");
    }

    @Override
    public void onFocusPointsChanged() {
        Log.e(TAG, "onFocusPointsChanged");
    }

    @Override
    public void onObjectAdded(int handle, int format) {
        Log.e(TAG, "onObjectAdded" + handle);
    }

    @Override
    public void onNoCameraFound() {
        new AlertDialog.Builder(this)
                .setTitle("提示")
                .setMessage("Not Found Camera Device")
                .show();
        Log.e(TAG, "onNoCameraFound");
    }

    @Override
    public void onError(String message) {
        if ("Error in USB communication: Code CP -1 12".equals(message)) message = "USB拔出";
        new AlertDialog.Builder(this)
                .setTitle("提示")
                .setMessage(message)
                .show();
    }

}

